<html>
<head><meta charset="utf-8"><title>Miri: unsupported operation when isolation enabled · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html">Miri: unsupported operation when isolation enabled</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214327241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214327241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214327241">(Oct 23 2020 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> Is this a playground issue or a Miri issue?</p>
<div class="codehilite"><pre><span></span><code>error: unsupported operation: `open` not available when isolation is enabled
   --&gt; /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fs.rs:745:36
    |
745 |         let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode as c_int) })?;
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `open` not available when isolation is enabled
    |
    = help: pass the flag `-Zmiri-disable-isolation` to disable isolation
</code></pre></div>


<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=a21d54dd27daf83c07ab7b9e4b5ae64e">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=a21d54dd27daf83c07ab7b9e4b5ae64e</a></p>



<a name="214330002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214330002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214330002">(Oct 23 2020 at 15:46)</a>:</h4>
<p>Rayon uses the <code>num_cpus</code> crate, which opens a file. This is not allowed when <code>-Zmiri-disable-isolation</code> is not passed.</p>



<a name="214332197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214332197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214332197">(Oct 23 2020 at 16:05)</a>:</h4>
<p>You could use the builder to set the number of threads yourself</p>



<a name="214335757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214335757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214335757">(Oct 23 2020 at 16:36)</a>:</h4>
<p>yeah recent num_cpus unfortunately try to access the file system :/</p>



<a name="214335847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214335847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214335847">(Oct 23 2020 at 16:36)</a>:</h4>
<p>Ideally we'd make <code>open</code> fail instead of aborting execution: <a href="https://github.com/rust-lang/miri/issues/1034">https://github.com/rust-lang/miri/issues/1034</a></p>



<a name="214335912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214335912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214335912">(Oct 23 2020 at 16:37)</a>:</h4>
<p>potentially the playground should just disable isolation?</p>



<a name="214335974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214335974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214335974">(Oct 23 2020 at 16:37)</a>:</h4>
<p>the main disadvantage is that you lose perfect determinism, which can be annoying when using some of the <code>-Ztrack-*</code> flags, but you cannot use those on the playground anyway</p>



<a name="214336094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214336094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214336094">(Oct 23 2020 at 16:38)</a>:</h4>
<p>also the libtest runner slows down a lot when you do that (I think it does something with the evnrionment), but I doubt people usually run that on playground... without being able to pass <code>--test</code> that seems hard anyway</p>



<a name="214337217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214337217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214337217">(Oct 23 2020 at 16:47)</a>:</h4>
<p>I was a bit confused because I don't get the error locally, but I guess that's because it doesn't open the file on macOS.</p>



<a name="214337587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214337587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214337587">(Oct 23 2020 at 16:50)</a>:</h4>
<blockquote>
<p>lose perfect determinism</p>
</blockquote>
<p>I guess the playground has a higher amount of determinism, as most things that can change are already locked away. Things like time can change, of course.</p>



<a name="214338236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214338236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214338236">(Oct 23 2020 at 16:55)</a>:</h4>
<p>Perhaps <code>num_cpus</code> should get a <code>cfg(miri)</code> case?</p>



<a name="214338296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214338296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214338296">(Oct 23 2020 at 16:56)</a>:</h4>
<p>not that this addresses the general problem</p>



<a name="214349825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214349825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214349825">(Oct 23 2020 at 18:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled/near/214337217">said</a>:</p>
<blockquote>
<p>I was a bit confused because I don't get the error locally, but I guess that's because it doesn't open the file on macOS.</p>
</blockquote>
<p>Yeah, it seems like it only does it for Linux: <a href="https://github.com/seanmonstar/num_cpus/blob/master/src/linux.rs">https://github.com/seanmonstar/num_cpus/blob/master/src/linux.rs</a></p>



<a name="214417665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Miri%3A%20unsupported%20operation%20when%20isolation%20enabled/near/214417665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Miri.3A.20unsupported.20operation.20when.20isolation.20enabled.html#214417665">(Oct 24 2020 at 09:27)</a>:</h4>
<p><a href="https://github.com/integer32llc/rust-playground/pull/641">https://github.com/integer32llc/rust-playground/pull/641</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>